package com.irdstudio.efp.esb.service.facade;

import com.irdstudio.basic.framework.core.exception.ESBException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 需求编号:2019D0910
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2019/8/20
 * 功能描述:
 * 修改日期:2019/8/20
 * 修改描述:
 */
public class EsbInvokerWorker implements Runnable {
    // EsbInvoker Runner
    private EsbInvokeWrapper esbInvokeWrapper;
    // 日志
    private static Logger logger = LoggerFactory.getLogger(EsbInvokerWorker.class);

    public EsbInvokerWorker(EsbInvokeWrapper esbInvokeWrapper) {
        this.esbInvokeWrapper = esbInvokeWrapper;
    }

    @Override
    public void run() {
        try {
            esbInvokeWrapper.invoke3Threes();
        } catch (ESBException e) {
            logger.error("调用接口3次后被中断:"+e.getMessage());
            e.printStackTrace();
        } catch (InterruptedException e) {
            logger.error("调用接口时被中断:"+e.getMessage());
            e.printStackTrace();
        }
    }
}
